<?php

namespace App\Http\Controllers\Plugin;
use App\Helpers\ResponseData;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
//前端直传功能
//composer require alibabacloud/sdk
//composer require alibabacloud/client
class DirectUploadController extends Controller
{
    use AliAssumeRole,ResponseData,OssDirectSign,OssController;
   //获取sts凭证
    public function getAppToken(){
        $data = self::main();
        return $this->success($data);
    }
    public function getWebToken(){
        $data = $this->getWebSign();
        return $this->success($data);
    }
    //拷贝图片数据
    public function copyUploadImg(Request $request){
        $data = $this->copyImg($request->object);
        return $this->success($data);
    }
    public function callback(Request $request){
       // info(json_encode($request->all()));
        return $this->success('成功');
    }
}
